<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>时间</title>
</head>

<body>
  <script>
    let timer = +prompt('请输入秒数')
    function getTime(t) {
      let h = parseInt(t / 60 / 60 % 24)
      let m = parseInt(t / 60 % 60)
      let s = parseInt(t % 60)
      // h > 10 ? h : '0' + h
      console.log('小时是' + (h >= 10 ? h : ('0' + h)));
      console.log('分钟是' + (m >= 10 ? m : ('0' + m)));
      console.log('秒数是' + (s >= 10 ? s : ('0' + s)));
    }
    getTime(timer)
  </script>
</body>

</html>